<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.9.1"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Serialib: lib/serialib.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">Serialib
   &#160;<span id="projectnumber">2.0</span>
   </div>
   <div id="projectbrief">Multi plateform serial library</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.1 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search','.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(document).ready(function(){initNavTree('serialib_8h_source.html',''); initResizable(); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="headertitle">
<div class="title">serialib.h</div>  </div>
</div><!--header-->
<div class="contents">
<a href="serialib_8h.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160; </div>
<div class="line"><a name="l00019"></a><span class="lineno">   19</span>&#160;<span class="preprocessor">#ifndef SERIALIB_H</span></div>
<div class="line"><a name="l00020"></a><span class="lineno">   20</span>&#160;<span class="preprocessor">#define SERIALIB_H</span></div>
<div class="line"><a name="l00021"></a><span class="lineno">   21</span>&#160; </div>
<div class="line"><a name="l00022"></a><span class="lineno">   22</span>&#160; </div>
<div class="line"><a name="l00023"></a><span class="lineno">   23</span>&#160; </div>
<div class="line"><a name="l00024"></a><span class="lineno">   24</span>&#160;<span class="comment">// Used for TimeOut operations</span></div>
<div class="line"><a name="l00025"></a><span class="lineno">   25</span>&#160;<span class="preprocessor">#include &lt;sys/time.h&gt;</span></div>
<div class="line"><a name="l00026"></a><span class="lineno">   26</span>&#160;<span class="comment">// Include for windows</span></div>
<div class="line"><a name="l00027"></a><span class="lineno">   27</span>&#160;<span class="preprocessor">#if defined (_WIN32) || defined (_WIN64)</span></div>
<div class="line"><a name="l00028"></a><span class="lineno">   28</span>&#160;    <span class="comment">// Accessing to the serial port under Windows</span></div>
<div class="line"><a name="l00029"></a><span class="lineno">   29</span>&#160;<span class="preprocessor">    #include &lt;windows.h&gt;</span></div>
<div class="line"><a name="l00030"></a><span class="lineno">   30</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00031"></a><span class="lineno">   31</span>&#160; </div>
<div class="line"><a name="l00032"></a><span class="lineno">   32</span>&#160;<span class="comment">// Include for Linux</span></div>
<div class="line"><a name="l00033"></a><span class="lineno">   33</span>&#160;<span class="preprocessor">#if defined (__linux__) || defined(__APPLE__)</span></div>
<div class="line"><a name="l00034"></a><span class="lineno">   34</span>&#160;<span class="preprocessor">    #include &lt;stdlib.h&gt;</span></div>
<div class="line"><a name="l00035"></a><span class="lineno">   35</span>&#160;<span class="preprocessor">    #include &lt;sys/types.h&gt;</span></div>
<div class="line"><a name="l00036"></a><span class="lineno">   36</span>&#160;<span class="preprocessor">    #include &lt;sys/shm.h&gt;</span></div>
<div class="line"><a name="l00037"></a><span class="lineno">   37</span>&#160;<span class="preprocessor">    #include &lt;termios.h&gt;</span></div>
<div class="line"><a name="l00038"></a><span class="lineno">   38</span>&#160;<span class="preprocessor">    #include &lt;string.h&gt;</span></div>
<div class="line"><a name="l00039"></a><span class="lineno">   39</span>&#160;<span class="preprocessor">    #include &lt;iostream&gt;</span></div>
<div class="line"><a name="l00040"></a><span class="lineno">   40</span>&#160;    <span class="comment">// File control definitions</span></div>
<div class="line"><a name="l00041"></a><span class="lineno">   41</span>&#160;<span class="preprocessor">    #include &lt;fcntl.h&gt;</span></div>
<div class="line"><a name="l00042"></a><span class="lineno">   42</span>&#160;<span class="preprocessor">    #include &lt;unistd.h&gt;</span></div>
<div class="line"><a name="l00043"></a><span class="lineno">   43</span>&#160;<span class="preprocessor">    #include &lt;sys/ioctl.h&gt;</span></div>
<div class="line"><a name="l00044"></a><span class="lineno">   44</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00045"></a><span class="lineno">   45</span>&#160; </div>
<div class="line"><a name="l00046"></a><span class="lineno">   46</span>&#160; </div>
<div class="line"><a name="l00048"></a><span class="lineno"><a class="line" href="serialib_8h.html#a86d500a34c624c2cae56bc25a31b12f3">   48</a></span>&#160;<span class="preprocessor">#define UNUSED(x) (void)(x)</span></div>
<div class="line"><a name="l00049"></a><span class="lineno">   49</span>&#160; </div>
<div class="line"><a name="l00053"></a><span class="lineno"><a class="line" href="serialib_8h.html#a1ecb786dca6b3ea0df424552bd25aba7">   53</a></span>&#160;<span class="keyword">enum</span> <a class="code" href="serialib_8h.html#a1ecb786dca6b3ea0df424552bd25aba7">SerialDataBits</a> {</div>
<div class="line"><a name="l00054"></a><span class="lineno"><a class="line" href="serialib_8h.html#a1ecb786dca6b3ea0df424552bd25aba7a0af46a1b1917daf04f071cc62409b1d0">   54</a></span>&#160;    <a class="code" href="serialib_8h.html#a1ecb786dca6b3ea0df424552bd25aba7a0af46a1b1917daf04f071cc62409b1d0">SERIAL_DATABITS_5</a>, </div>
<div class="line"><a name="l00055"></a><span class="lineno"><a class="line" href="serialib_8h.html#a1ecb786dca6b3ea0df424552bd25aba7af037109ad2db2f77d36c2a9806b23978">   55</a></span>&#160;    <a class="code" href="serialib_8h.html#a1ecb786dca6b3ea0df424552bd25aba7af037109ad2db2f77d36c2a9806b23978">SERIAL_DATABITS_6</a>, </div>
<div class="line"><a name="l00056"></a><span class="lineno"><a class="line" href="serialib_8h.html#a1ecb786dca6b3ea0df424552bd25aba7aeaccb09be92b75b1ac6a327eb21fb161">   56</a></span>&#160;    <a class="code" href="serialib_8h.html#a1ecb786dca6b3ea0df424552bd25aba7aeaccb09be92b75b1ac6a327eb21fb161">SERIAL_DATABITS_7</a>, </div>
<div class="line"><a name="l00057"></a><span class="lineno"><a class="line" href="serialib_8h.html#a1ecb786dca6b3ea0df424552bd25aba7ae7d27f5b5b60277dccbadd399897606d">   57</a></span>&#160;    <a class="code" href="serialib_8h.html#a1ecb786dca6b3ea0df424552bd25aba7ae7d27f5b5b60277dccbadd399897606d">SERIAL_DATABITS_8</a>,  </div>
<div class="line"><a name="l00058"></a><span class="lineno"><a class="line" href="serialib_8h.html#a1ecb786dca6b3ea0df424552bd25aba7a5c284f8eb4f32fa561544a95e506227d">   58</a></span>&#160;    <a class="code" href="serialib_8h.html#a1ecb786dca6b3ea0df424552bd25aba7a5c284f8eb4f32fa561544a95e506227d">SERIAL_DATABITS_16</a>,  </div>
<div class="line"><a name="l00059"></a><span class="lineno">   59</span>&#160;};</div>
<div class="line"><a name="l00060"></a><span class="lineno">   60</span>&#160; </div>
<div class="line"><a name="l00064"></a><span class="lineno"><a class="line" href="serialib_8h.html#aa2678ddd8376c65d7cad07cd6cae5654">   64</a></span>&#160;<span class="keyword">enum</span> <a class="code" href="serialib_8h.html#aa2678ddd8376c65d7cad07cd6cae5654">SerialStopBits</a> {</div>
<div class="line"><a name="l00065"></a><span class="lineno"><a class="line" href="serialib_8h.html#aa2678ddd8376c65d7cad07cd6cae5654a5d487c59b00736410f8512b345ce6a0d">   65</a></span>&#160;    <a class="code" href="serialib_8h.html#aa2678ddd8376c65d7cad07cd6cae5654a5d487c59b00736410f8512b345ce6a0d">SERIAL_STOPBITS_1</a>, </div>
<div class="line"><a name="l00066"></a><span class="lineno"><a class="line" href="serialib_8h.html#aa2678ddd8376c65d7cad07cd6cae5654a5e9a6cef3d12988dba0fa9b9053ec3cc">   66</a></span>&#160;    <a class="code" href="serialib_8h.html#aa2678ddd8376c65d7cad07cd6cae5654a5e9a6cef3d12988dba0fa9b9053ec3cc">SERIAL_STOPBITS_1_5</a>, </div>
<div class="line"><a name="l00067"></a><span class="lineno"><a class="line" href="serialib_8h.html#aa2678ddd8376c65d7cad07cd6cae5654a031c032346661741186af9d0680782ec">   67</a></span>&#160;    <a class="code" href="serialib_8h.html#aa2678ddd8376c65d7cad07cd6cae5654a031c032346661741186af9d0680782ec">SERIAL_STOPBITS_2</a>, </div>
<div class="line"><a name="l00068"></a><span class="lineno">   68</span>&#160;};</div>
<div class="line"><a name="l00069"></a><span class="lineno">   69</span>&#160; </div>
<div class="line"><a name="l00073"></a><span class="lineno"><a class="line" href="serialib_8h.html#a2c48912c12fd98a4f4faffbc7f20a9f6">   73</a></span>&#160;<span class="keyword">enum</span> <a class="code" href="serialib_8h.html#a2c48912c12fd98a4f4faffbc7f20a9f6">SerialParity</a> {</div>
<div class="line"><a name="l00074"></a><span class="lineno"><a class="line" href="serialib_8h.html#a2c48912c12fd98a4f4faffbc7f20a9f6a38bc0d79b89ff9341767232da5448fe8">   74</a></span>&#160;    <a class="code" href="serialib_8h.html#a2c48912c12fd98a4f4faffbc7f20a9f6a38bc0d79b89ff9341767232da5448fe8">SERIAL_PARITY_NONE</a>, </div>
<div class="line"><a name="l00075"></a><span class="lineno"><a class="line" href="serialib_8h.html#a2c48912c12fd98a4f4faffbc7f20a9f6a0392c989829d4e47a2cc54a12cb6125a">   75</a></span>&#160;    <a class="code" href="serialib_8h.html#a2c48912c12fd98a4f4faffbc7f20a9f6a0392c989829d4e47a2cc54a12cb6125a">SERIAL_PARITY_EVEN</a>, </div>
<div class="line"><a name="l00076"></a><span class="lineno"><a class="line" href="serialib_8h.html#a2c48912c12fd98a4f4faffbc7f20a9f6ab3213e8e4b9f1199aac388ed1b671a6e">   76</a></span>&#160;    <a class="code" href="serialib_8h.html#a2c48912c12fd98a4f4faffbc7f20a9f6ab3213e8e4b9f1199aac388ed1b671a6e">SERIAL_PARITY_ODD</a>, </div>
<div class="line"><a name="l00077"></a><span class="lineno"><a class="line" href="serialib_8h.html#a2c48912c12fd98a4f4faffbc7f20a9f6a2ba4057e060ceb427fb3105ef629ccf6">   77</a></span>&#160;    <a class="code" href="serialib_8h.html#a2c48912c12fd98a4f4faffbc7f20a9f6a2ba4057e060ceb427fb3105ef629ccf6">SERIAL_PARITY_MARK</a>, </div>
<div class="line"><a name="l00078"></a><span class="lineno">   78</span>&#160;    <a class="code" href="serialib_8h.html#a2c48912c12fd98a4f4faffbc7f20a9f6a10bed0b14962edaf7e883bf186d4773b">SERIAL_PARITY_SPACE</a> </div>
<div class="line"><a name="l00079"></a><span class="lineno"><a class="line" href="serialib_8h.html#a2c48912c12fd98a4f4faffbc7f20a9f6a10bed0b14962edaf7e883bf186d4773b">   79</a></span>&#160;};</div>
<div class="line"><a name="l00080"></a><span class="lineno">   80</span>&#160; </div>
<div class="line"><a name="l00084"></a><span class="lineno"><a class="line" href="classserialib.html">   84</a></span>&#160;<span class="keyword">class </span><a class="code" href="classserialib.html">serialib</a></div>
<div class="line"><a name="l00085"></a><span class="lineno">   85</span>&#160;{</div>
<div class="line"><a name="l00086"></a><span class="lineno">   86</span>&#160;<span class="keyword">public</span>:</div>
<div class="line"><a name="l00087"></a><span class="lineno">   87</span>&#160; </div>
<div class="line"><a name="l00088"></a><span class="lineno">   88</span>&#160;    <span class="comment">//_____________________________________</span></div>
<div class="line"><a name="l00089"></a><span class="lineno">   89</span>&#160;    <span class="comment">// ::: Constructors and destructors :::</span></div>
<div class="line"><a name="l00090"></a><span class="lineno">   90</span>&#160; </div>
<div class="line"><a name="l00091"></a><span class="lineno">   91</span>&#160; </div>
<div class="line"><a name="l00092"></a><span class="lineno">   92</span>&#160; </div>
<div class="line"><a name="l00093"></a><span class="lineno">   93</span>&#160;    <span class="comment">// Constructor of the class</span></div>
<div class="line"><a name="l00094"></a><span class="lineno">   94</span>&#160;    <a class="code" href="classserialib.html#a26166f63ad73013ca7cbcd2ae59edc91">serialib</a>    ();</div>
<div class="line"><a name="l00095"></a><span class="lineno">   95</span>&#160; </div>
<div class="line"><a name="l00096"></a><span class="lineno">   96</span>&#160;    <span class="comment">// Destructor</span></div>
<div class="line"><a name="l00097"></a><span class="lineno">   97</span>&#160;    <a class="code" href="classserialib.html#ac44215001ae198f2c196bb7993327a4b">~serialib</a>   ();</div>
<div class="line"><a name="l00098"></a><span class="lineno">   98</span>&#160; </div>
<div class="line"><a name="l00099"></a><span class="lineno">   99</span>&#160; </div>
<div class="line"><a name="l00100"></a><span class="lineno">  100</span>&#160; </div>
<div class="line"><a name="l00101"></a><span class="lineno">  101</span>&#160;    <span class="comment">//_________________________________________</span></div>
<div class="line"><a name="l00102"></a><span class="lineno">  102</span>&#160;    <span class="comment">// ::: Configuration and initialization :::</span></div>
<div class="line"><a name="l00103"></a><span class="lineno">  103</span>&#160; </div>
<div class="line"><a name="l00104"></a><span class="lineno">  104</span>&#160; </div>
<div class="line"><a name="l00105"></a><span class="lineno">  105</span>&#160;    <span class="comment">// Open a device</span></div>
<div class="line"><a name="l00106"></a><span class="lineno">  106</span>&#160;    <span class="keywordtype">char</span> <a class="code" href="classserialib.html#afcef685b74a3db58dc2d1898bb34aaca">openDevice</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> *Device, <span class="keyword">const</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> Bauds,</div>
<div class="line"><a name="l00107"></a><span class="lineno">  107</span>&#160;                    <a class="code" href="serialib_8h.html#a1ecb786dca6b3ea0df424552bd25aba7">SerialDataBits</a> Databits = <a class="code" href="serialib_8h.html#a1ecb786dca6b3ea0df424552bd25aba7ae7d27f5b5b60277dccbadd399897606d">SERIAL_DATABITS_8</a>,</div>
<div class="line"><a name="l00108"></a><span class="lineno">  108</span>&#160;                    <a class="code" href="serialib_8h.html#a2c48912c12fd98a4f4faffbc7f20a9f6">SerialParity</a> Parity = <a class="code" href="serialib_8h.html#a2c48912c12fd98a4f4faffbc7f20a9f6a38bc0d79b89ff9341767232da5448fe8">SERIAL_PARITY_NONE</a>,</div>
<div class="line"><a name="l00109"></a><span class="lineno">  109</span>&#160;                    <a class="code" href="serialib_8h.html#aa2678ddd8376c65d7cad07cd6cae5654">SerialStopBits</a> Stopbits = <a class="code" href="serialib_8h.html#aa2678ddd8376c65d7cad07cd6cae5654a5d487c59b00736410f8512b345ce6a0d">SERIAL_STOPBITS_1</a>);</div>
<div class="line"><a name="l00110"></a><span class="lineno">  110</span>&#160; </div>
<div class="line"><a name="l00111"></a><span class="lineno">  111</span>&#160;    <span class="comment">// Close the current device</span></div>
<div class="line"><a name="l00112"></a><span class="lineno">  112</span>&#160;    <span class="keywordtype">void</span>    <a class="code" href="classserialib.html#a8a1c8803c8df1a19222d6006328534b8">closeDevice</a>();</div>
<div class="line"><a name="l00113"></a><span class="lineno">  113</span>&#160; </div>
<div class="line"><a name="l00114"></a><span class="lineno">  114</span>&#160; </div>
<div class="line"><a name="l00115"></a><span class="lineno">  115</span>&#160; </div>
<div class="line"><a name="l00116"></a><span class="lineno">  116</span>&#160; </div>
<div class="line"><a name="l00117"></a><span class="lineno">  117</span>&#160;    <span class="comment">//___________________________________________</span></div>
<div class="line"><a name="l00118"></a><span class="lineno">  118</span>&#160;    <span class="comment">// ::: Read/Write operation on characters :::</span></div>
<div class="line"><a name="l00119"></a><span class="lineno">  119</span>&#160; </div>
<div class="line"><a name="l00120"></a><span class="lineno">  120</span>&#160; </div>
<div class="line"><a name="l00121"></a><span class="lineno">  121</span>&#160;    <span class="comment">// Write a char</span></div>
<div class="line"><a name="l00122"></a><span class="lineno">  122</span>&#160;    <span class="keywordtype">char</span>    <a class="code" href="classserialib.html#aa6d231cb99664a613bcb503830f73497">writeChar</a>   (<span class="keywordtype">char</span>);</div>
<div class="line"><a name="l00123"></a><span class="lineno">  123</span>&#160; </div>
<div class="line"><a name="l00124"></a><span class="lineno">  124</span>&#160;    <span class="comment">// Read a char (with timeout)</span></div>
<div class="line"><a name="l00125"></a><span class="lineno">  125</span>&#160;    <span class="keywordtype">char</span>    <a class="code" href="classserialib.html#a6c78b8a11ae7b8af57eea3dbc7fa237b">readChar</a>    (<span class="keywordtype">char</span> *pByte,<span class="keyword">const</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> timeOut_ms=0);</div>
<div class="line"><a name="l00126"></a><span class="lineno">  126</span>&#160; </div>
<div class="line"><a name="l00127"></a><span class="lineno">  127</span>&#160; </div>
<div class="line"><a name="l00128"></a><span class="lineno">  128</span>&#160; </div>
<div class="line"><a name="l00129"></a><span class="lineno">  129</span>&#160; </div>
<div class="line"><a name="l00130"></a><span class="lineno">  130</span>&#160;    <span class="comment">//________________________________________</span></div>
<div class="line"><a name="l00131"></a><span class="lineno">  131</span>&#160;    <span class="comment">// ::: Read/Write operation on strings :::</span></div>
<div class="line"><a name="l00132"></a><span class="lineno">  132</span>&#160; </div>
<div class="line"><a name="l00133"></a><span class="lineno">  133</span>&#160; </div>
<div class="line"><a name="l00134"></a><span class="lineno">  134</span>&#160;    <span class="comment">// Write a string</span></div>
<div class="line"><a name="l00135"></a><span class="lineno">  135</span>&#160;    <span class="keywordtype">char</span>    <a class="code" href="classserialib.html#a6a32655c718b998e5b63d8cdc483ac6d">writeString</a> (<span class="keyword">const</span> <span class="keywordtype">char</span> *String);</div>
<div class="line"><a name="l00136"></a><span class="lineno">  136</span>&#160; </div>
<div class="line"><a name="l00137"></a><span class="lineno">  137</span>&#160;    <span class="comment">// Read a string (with timeout)</span></div>
<div class="line"><a name="l00138"></a><span class="lineno">  138</span>&#160;    <span class="keywordtype">int</span>     <a class="code" href="classserialib.html#ab155c84352ddefe1304d391c19497ac1">readString</a>  (   <span class="keywordtype">char</span> *receivedString,</div>
<div class="line"><a name="l00139"></a><span class="lineno">  139</span>&#160;                            <span class="keywordtype">char</span> finalChar,</div>
<div class="line"><a name="l00140"></a><span class="lineno">  140</span>&#160;                            <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> maxNbBytes,</div>
<div class="line"><a name="l00141"></a><span class="lineno">  141</span>&#160;                            <span class="keyword">const</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> timeOut_ms=0);</div>
<div class="line"><a name="l00142"></a><span class="lineno">  142</span>&#160; </div>
<div class="line"><a name="l00143"></a><span class="lineno">  143</span>&#160; </div>
<div class="line"><a name="l00144"></a><span class="lineno">  144</span>&#160; </div>
<div class="line"><a name="l00145"></a><span class="lineno">  145</span>&#160;    <span class="comment">// _____________________________________</span></div>
<div class="line"><a name="l00146"></a><span class="lineno">  146</span>&#160;    <span class="comment">// ::: Read/Write operation on bytes :::</span></div>
<div class="line"><a name="l00147"></a><span class="lineno">  147</span>&#160; </div>
<div class="line"><a name="l00148"></a><span class="lineno">  148</span>&#160; </div>
<div class="line"><a name="l00149"></a><span class="lineno">  149</span>&#160;    <span class="comment">// Write an array of bytes</span></div>
<div class="line"><a name="l00150"></a><span class="lineno">  150</span>&#160;    <span class="keywordtype">char</span>    <a class="code" href="classserialib.html#aa14196b6f422584bf5eebc4ddb71d483">writeBytes</a>  (<span class="keyword">const</span> <span class="keywordtype">void</span> *Buffer, <span class="keyword">const</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> NbBytes);</div>
<div class="line"><a name="l00151"></a><span class="lineno">  151</span>&#160; </div>
<div class="line"><a name="l00152"></a><span class="lineno">  152</span>&#160;    <span class="comment">// Read an array of byte (with timeout)</span></div>
<div class="line"><a name="l00153"></a><span class="lineno">  153</span>&#160;    <span class="keywordtype">int</span>     <a class="code" href="classserialib.html#ab05e51ff3bc47c02d7d000d58b45a961">readBytes</a>   (<span class="keywordtype">void</span> *buffer,<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> maxNbBytes,<span class="keyword">const</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> timeOut_ms=0, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> sleepDuration_us=100);</div>
<div class="line"><a name="l00154"></a><span class="lineno">  154</span>&#160; </div>
<div class="line"><a name="l00155"></a><span class="lineno">  155</span>&#160; </div>
<div class="line"><a name="l00156"></a><span class="lineno">  156</span>&#160; </div>
<div class="line"><a name="l00157"></a><span class="lineno">  157</span>&#160; </div>
<div class="line"><a name="l00158"></a><span class="lineno">  158</span>&#160;    <span class="comment">// _________________________</span></div>
<div class="line"><a name="l00159"></a><span class="lineno">  159</span>&#160;    <span class="comment">// ::: Special operation :::</span></div>
<div class="line"><a name="l00160"></a><span class="lineno">  160</span>&#160; </div>
<div class="line"><a name="l00161"></a><span class="lineno">  161</span>&#160; </div>
<div class="line"><a name="l00162"></a><span class="lineno">  162</span>&#160;    <span class="comment">// Empty the received buffer</span></div>
<div class="line"><a name="l00163"></a><span class="lineno">  163</span>&#160;    <span class="keywordtype">char</span>    <a class="code" href="classserialib.html#a572dd8d208511ec81d848de72cb05c7a">flushReceiver</a>();</div>
<div class="line"><a name="l00164"></a><span class="lineno">  164</span>&#160; </div>
<div class="line"><a name="l00165"></a><span class="lineno">  165</span>&#160;    <span class="comment">// Return the number of bytes in the received buffer</span></div>
<div class="line"><a name="l00166"></a><span class="lineno">  166</span>&#160;    <span class="keywordtype">int</span>     <a class="code" href="classserialib.html#a50c91bf8cab23afdfdf05ca58392456f">available</a>();</div>
<div class="line"><a name="l00167"></a><span class="lineno">  167</span>&#160; </div>
<div class="line"><a name="l00168"></a><span class="lineno">  168</span>&#160; </div>
<div class="line"><a name="l00169"></a><span class="lineno">  169</span>&#160; </div>
<div class="line"><a name="l00170"></a><span class="lineno">  170</span>&#160; </div>
<div class="line"><a name="l00171"></a><span class="lineno">  171</span>&#160;    <span class="comment">// _________________________</span></div>
<div class="line"><a name="l00172"></a><span class="lineno">  172</span>&#160;    <span class="comment">// ::: Access to IO bits :::</span></div>
<div class="line"><a name="l00173"></a><span class="lineno">  173</span>&#160; </div>
<div class="line"><a name="l00174"></a><span class="lineno">  174</span>&#160; </div>
<div class="line"><a name="l00175"></a><span class="lineno">  175</span>&#160;    <span class="comment">// Set CTR status (Data Terminal Ready, pin 4)</span></div>
<div class="line"><a name="l00176"></a><span class="lineno">  176</span>&#160;    <span class="keywordtype">bool</span>    <a class="code" href="classserialib.html#a3dc0ec56e84ab2b43dc02fc2e02148a1">DTR</a>(<span class="keywordtype">bool</span> status);</div>
<div class="line"><a name="l00177"></a><span class="lineno">  177</span>&#160;    <span class="keywordtype">bool</span>    <a class="code" href="classserialib.html#a7564b9e28b1b50675d9d6d3fabc896c0">setDTR</a>();</div>
<div class="line"><a name="l00178"></a><span class="lineno">  178</span>&#160;    <span class="keywordtype">bool</span>    <a class="code" href="classserialib.html#adf49bff6401d3101b41fb52e98309635">clearDTR</a>();</div>
<div class="line"><a name="l00179"></a><span class="lineno">  179</span>&#160; </div>
<div class="line"><a name="l00180"></a><span class="lineno">  180</span>&#160;    <span class="comment">// Set RTS status (Request To Send, pin 7)</span></div>
<div class="line"><a name="l00181"></a><span class="lineno">  181</span>&#160;    <span class="keywordtype">bool</span>    <a class="code" href="classserialib.html#a5a73f159762fa4d5c252f36acfe7ab47">RTS</a>(<span class="keywordtype">bool</span> status);</div>
<div class="line"><a name="l00182"></a><span class="lineno">  182</span>&#160;    <span class="keywordtype">bool</span>    <a class="code" href="classserialib.html#a21767ffe86a76f300a71c496fbcc26a1">setRTS</a>();</div>
<div class="line"><a name="l00183"></a><span class="lineno">  183</span>&#160;    <span class="keywordtype">bool</span>    <a class="code" href="classserialib.html#ab0b5882339240002fccf7701f5321e0a">clearRTS</a>();</div>
<div class="line"><a name="l00184"></a><span class="lineno">  184</span>&#160; </div>
<div class="line"><a name="l00185"></a><span class="lineno">  185</span>&#160;    <span class="comment">// Get RI status (Ring Indicator, pin 9)</span></div>
<div class="line"><a name="l00186"></a><span class="lineno">  186</span>&#160;    <span class="keywordtype">bool</span>    <a class="code" href="classserialib.html#a605d8a8015fadb5db5521350aefe084e">isRI</a>();</div>
<div class="line"><a name="l00187"></a><span class="lineno">  187</span>&#160; </div>
<div class="line"><a name="l00188"></a><span class="lineno">  188</span>&#160;    <span class="comment">// Get DCD status (Data Carrier Detect, pin 1)</span></div>
<div class="line"><a name="l00189"></a><span class="lineno">  189</span>&#160;    <span class="keywordtype">bool</span>    <a class="code" href="classserialib.html#a5f451a5eea7c8c1bdcff684ba131d6ff">isDCD</a>();</div>
<div class="line"><a name="l00190"></a><span class="lineno">  190</span>&#160; </div>
<div class="line"><a name="l00191"></a><span class="lineno">  191</span>&#160;    <span class="comment">// Get CTS status (Clear To Send, pin 8)</span></div>
<div class="line"><a name="l00192"></a><span class="lineno">  192</span>&#160;    <span class="keywordtype">bool</span>    <a class="code" href="classserialib.html#aca544a6f8dfa33f8e771713646768215">isCTS</a>();</div>
<div class="line"><a name="l00193"></a><span class="lineno">  193</span>&#160; </div>
<div class="line"><a name="l00194"></a><span class="lineno">  194</span>&#160;    <span class="comment">// Get DSR status (Data Set Ready, pin 9)</span></div>
<div class="line"><a name="l00195"></a><span class="lineno">  195</span>&#160;    <span class="keywordtype">bool</span>    <a class="code" href="classserialib.html#a3f1f0894543dfb17955de50157965dd7">isDSR</a>();</div>
<div class="line"><a name="l00196"></a><span class="lineno">  196</span>&#160; </div>
<div class="line"><a name="l00197"></a><span class="lineno">  197</span>&#160;    <span class="comment">// Get RTS status (Request To Send, pin 7)</span></div>
<div class="line"><a name="l00198"></a><span class="lineno">  198</span>&#160;    <span class="keywordtype">bool</span>    <a class="code" href="classserialib.html#ab2b121af07fb732f82668f6a14e93cfb">isRTS</a>();</div>
<div class="line"><a name="l00199"></a><span class="lineno">  199</span>&#160; </div>
<div class="line"><a name="l00200"></a><span class="lineno">  200</span>&#160;    <span class="comment">// Get CTR status (Data Terminal Ready, pin 4)</span></div>
<div class="line"><a name="l00201"></a><span class="lineno">  201</span>&#160;    <span class="keywordtype">bool</span>    <a class="code" href="classserialib.html#a4ec78286be81602bf1df44a4eb8372a8">isDTR</a>();</div>
<div class="line"><a name="l00202"></a><span class="lineno">  202</span>&#160; </div>
<div class="line"><a name="l00203"></a><span class="lineno">  203</span>&#160; </div>
<div class="line"><a name="l00204"></a><span class="lineno">  204</span>&#160;<span class="keyword">private</span>:</div>
<div class="line"><a name="l00205"></a><span class="lineno">  205</span>&#160;    <span class="comment">// Read a string (no timeout)</span></div>
<div class="line"><a name="l00206"></a><span class="lineno">  206</span>&#160;    <span class="keywordtype">int</span>             readStringNoTimeOut  (<span class="keywordtype">char</span> *String,<span class="keywordtype">char</span> FinalChar,<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> MaxNbBytes);</div>
<div class="line"><a name="l00207"></a><span class="lineno">  207</span>&#160; </div>
<div class="line"><a name="l00208"></a><span class="lineno">  208</span>&#160;    <span class="comment">// Current DTR and RTS state (can&#39;t be read on WIndows)</span></div>
<div class="line"><a name="l00209"></a><span class="lineno">  209</span>&#160;    <span class="keywordtype">bool</span>            currentStateRTS;</div>
<div class="line"><a name="l00210"></a><span class="lineno">  210</span>&#160;    <span class="keywordtype">bool</span>            currentStateDTR;</div>
<div class="line"><a name="l00211"></a><span class="lineno">  211</span>&#160; </div>
<div class="line"><a name="l00212"></a><span class="lineno">  212</span>&#160; </div>
<div class="line"><a name="l00213"></a><span class="lineno">  213</span>&#160; </div>
<div class="line"><a name="l00214"></a><span class="lineno">  214</span>&#160; </div>
<div class="line"><a name="l00215"></a><span class="lineno">  215</span>&#160; </div>
<div class="line"><a name="l00216"></a><span class="lineno">  216</span>&#160;<span class="preprocessor">#if defined (_WIN32) || defined( _WIN64)</span></div>
<div class="line"><a name="l00217"></a><span class="lineno">  217</span>&#160;    <span class="comment">// Handle on serial device</span></div>
<div class="line"><a name="l00218"></a><span class="lineno">  218</span>&#160;    HANDLE          hSerial;</div>
<div class="line"><a name="l00219"></a><span class="lineno">  219</span>&#160;    <span class="comment">// For setting serial port timeouts</span></div>
<div class="line"><a name="l00220"></a><span class="lineno">  220</span>&#160;    COMMTIMEOUTS    timeouts;</div>
<div class="line"><a name="l00221"></a><span class="lineno">  221</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00222"></a><span class="lineno">  222</span>&#160;<span class="preprocessor">#if defined (__linux__) || defined(__APPLE__)</span></div>
<div class="line"><a name="l00223"></a><span class="lineno">  223</span>&#160;    <span class="keywordtype">int</span>             fd;</div>
<div class="line"><a name="l00224"></a><span class="lineno">  224</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00225"></a><span class="lineno">  225</span>&#160; </div>
<div class="line"><a name="l00226"></a><span class="lineno">  226</span>&#160;};</div>
<div class="line"><a name="l00227"></a><span class="lineno">  227</span>&#160; </div>
<div class="line"><a name="l00228"></a><span class="lineno">  228</span>&#160; </div>
<div class="line"><a name="l00229"></a><span class="lineno">  229</span>&#160; </div>
<div class="line"><a name="l00233"></a><span class="lineno">  233</span>&#160;<span class="comment">// Class timeOut</span></div>
<div class="line"><a name="l00234"></a><span class="lineno"><a class="line" href="classtime_out.html">  234</a></span>&#160;<span class="keyword">class </span><a class="code" href="classtime_out.html">timeOut</a></div>
<div class="line"><a name="l00235"></a><span class="lineno">  235</span>&#160;{</div>
<div class="line"><a name="l00236"></a><span class="lineno">  236</span>&#160;<span class="keyword">public</span>:</div>
<div class="line"><a name="l00237"></a><span class="lineno">  237</span>&#160; </div>
<div class="line"><a name="l00238"></a><span class="lineno">  238</span>&#160;    <span class="comment">// Constructor</span></div>
<div class="line"><a name="l00239"></a><span class="lineno">  239</span>&#160;    <a class="code" href="classtime_out.html#a2cffa89f7b90e4501e07e8cb7ccb3117">timeOut</a>();</div>
<div class="line"><a name="l00240"></a><span class="lineno">  240</span>&#160; </div>
<div class="line"><a name="l00241"></a><span class="lineno">  241</span>&#160;    <span class="comment">// Init the timer</span></div>
<div class="line"><a name="l00242"></a><span class="lineno">  242</span>&#160;    <span class="keywordtype">void</span>                <a class="code" href="classtime_out.html#a88b4caef4ce7bfc42b73a61589c098e8">initTimer</a>();</div>
<div class="line"><a name="l00243"></a><span class="lineno">  243</span>&#160; </div>
<div class="line"><a name="l00244"></a><span class="lineno">  244</span>&#160;    <span class="comment">// Return the elapsed time since initialization</span></div>
<div class="line"><a name="l00245"></a><span class="lineno">  245</span>&#160;    <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> <span class="keywordtype">int</span>   <a class="code" href="classtime_out.html#af5db5b5f0db4f6ada19187ef8f214214">elapsedTime_ms</a>();</div>
<div class="line"><a name="l00246"></a><span class="lineno">  246</span>&#160; </div>
<div class="line"><a name="l00247"></a><span class="lineno">  247</span>&#160;<span class="keyword">private</span>:</div>
<div class="line"><a name="l00248"></a><span class="lineno">  248</span>&#160;    <span class="comment">// Used to store the previous time (for computing timeout)</span></div>
<div class="line"><a name="l00249"></a><span class="lineno">  249</span>&#160;    <span class="keyword">struct </span>timeval      previousTime;</div>
<div class="line"><a name="l00250"></a><span class="lineno">  250</span>&#160;};</div>
<div class="line"><a name="l00251"></a><span class="lineno">  251</span>&#160; </div>
<div class="line"><a name="l00252"></a><span class="lineno">  252</span>&#160;<span class="preprocessor">#endif </span><span class="comment">// serialib_H</span></div>
<div class="ttc" id="aclassserialib_html"><div class="ttname"><a href="classserialib.html">serialib</a></div><div class="ttdoc">This class is used for communication over a serial device.</div><div class="ttdef"><b>Definition:</b> serialib.h:85</div></div>
<div class="ttc" id="aclassserialib_html_a21767ffe86a76f300a71c496fbcc26a1"><div class="ttname"><a href="classserialib.html#a21767ffe86a76f300a71c496fbcc26a1">serialib::setRTS</a></div><div class="ttdeci">bool setRTS()</div><div class="ttdoc">Set the bit RTS (pin 7) RTS stands for Data Terminal Ready.</div><div class="ttdef"><b>Definition:</b> serialib.cpp:806</div></div>
<div class="ttc" id="aclassserialib_html_a26166f63ad73013ca7cbcd2ae59edc91"><div class="ttname"><a href="classserialib.html#a26166f63ad73013ca7cbcd2ae59edc91">serialib::serialib</a></div><div class="ttdeci">serialib()</div><div class="ttdoc">Constructor of the class serialib.</div><div class="ttdef"><b>Definition:</b> serialib.cpp:29</div></div>
<div class="ttc" id="aclassserialib_html_a3dc0ec56e84ab2b43dc02fc2e02148a1"><div class="ttname"><a href="classserialib.html#a3dc0ec56e84ab2b43dc02fc2e02148a1">serialib::DTR</a></div><div class="ttdeci">bool DTR(bool status)</div><div class="ttdoc">Set or unset the bit DTR (pin 4) DTR stands for Data Terminal Ready Convenience method :This method c...</div><div class="ttdef"><b>Definition:</b> serialib.cpp:721</div></div>
<div class="ttc" id="aclassserialib_html_a3f1f0894543dfb17955de50157965dd7"><div class="ttname"><a href="classserialib.html#a3f1f0894543dfb17955de50157965dd7">serialib::isDSR</a></div><div class="ttdeci">bool isDSR()</div><div class="ttdoc">Get the DSR's status (pin 6) DSR stands for Data Set Ready.</div><div class="ttdef"><b>Definition:</b> serialib.cpp:878</div></div>
<div class="ttc" id="aclassserialib_html_a4ec78286be81602bf1df44a4eb8372a8"><div class="ttname"><a href="classserialib.html#a4ec78286be81602bf1df44a4eb8372a8">serialib::isDTR</a></div><div class="ttdeci">bool isDTR()</div><div class="ttdoc">Get the DTR's status (pin 4) DTR stands for Data Terminal Ready May behave abnormally on Windows.</div><div class="ttdef"><b>Definition:</b> serialib.cpp:947</div></div>
<div class="ttc" id="aclassserialib_html_a50c91bf8cab23afdfdf05ca58392456f"><div class="ttname"><a href="classserialib.html#a50c91bf8cab23afdfdf05ca58392456f">serialib::available</a></div><div class="ttdeci">int available()</div><div class="ttdoc">Return the number of bytes in the received buffer (UNIX only)</div><div class="ttdef"><b>Definition:</b> serialib.cpp:686</div></div>
<div class="ttc" id="aclassserialib_html_a572dd8d208511ec81d848de72cb05c7a"><div class="ttname"><a href="classserialib.html#a572dd8d208511ec81d848de72cb05c7a">serialib::flushReceiver</a></div><div class="ttdeci">char flushReceiver()</div><div class="ttdoc">Empty receiver buffer.</div><div class="ttdef"><b>Definition:</b> serialib.cpp:667</div></div>
<div class="ttc" id="aclassserialib_html_a5a73f159762fa4d5c252f36acfe7ab47"><div class="ttname"><a href="classserialib.html#a5a73f159762fa4d5c252f36acfe7ab47">serialib::RTS</a></div><div class="ttdeci">bool RTS(bool status)</div><div class="ttdoc">Set or unset the bit RTS (pin 7) RTS stands for Data Termina Ready Convenience method :This method ca...</div><div class="ttdef"><b>Definition:</b> serialib.cpp:789</div></div>
<div class="ttc" id="aclassserialib_html_a5f451a5eea7c8c1bdcff684ba131d6ff"><div class="ttname"><a href="classserialib.html#a5f451a5eea7c8c1bdcff684ba131d6ff">serialib::isDCD</a></div><div class="ttdeci">bool isDCD()</div><div class="ttdoc">Get the DCD's status (pin 1) CDC stands for Data Carrier Detect.</div><div class="ttdef"><b>Definition:</b> serialib.cpp:904</div></div>
<div class="ttc" id="aclassserialib_html_a605d8a8015fadb5db5521350aefe084e"><div class="ttname"><a href="classserialib.html#a605d8a8015fadb5db5521350aefe084e">serialib::isRI</a></div><div class="ttdeci">bool isRI()</div><div class="ttdoc">Get the RING's status (pin 9) Ring Indicator.</div><div class="ttdef"><b>Definition:</b> serialib.cpp:925</div></div>
<div class="ttc" id="aclassserialib_html_a6a32655c718b998e5b63d8cdc483ac6d"><div class="ttname"><a href="classserialib.html#a6a32655c718b998e5b63d8cdc483ac6d">serialib::writeString</a></div><div class="ttdeci">char writeString(const char *String)</div><div class="ttdoc">Write a string on the current serial port.</div><div class="ttdef"><b>Definition:</b> serialib.cpp:359</div></div>
<div class="ttc" id="aclassserialib_html_a6c78b8a11ae7b8af57eea3dbc7fa237b"><div class="ttname"><a href="classserialib.html#a6c78b8a11ae7b8af57eea3dbc7fa237b">serialib::readChar</a></div><div class="ttdeci">char readChar(char *pByte, const unsigned int timeOut_ms=0)</div><div class="ttdoc">Wait for a byte from the serial device and return the data read.</div><div class="ttdef"><b>Definition:</b> serialib.cpp:425</div></div>
<div class="ttc" id="aclassserialib_html_a7564b9e28b1b50675d9d6d3fabc896c0"><div class="ttname"><a href="classserialib.html#a7564b9e28b1b50675d9d6d3fabc896c0">serialib::setDTR</a></div><div class="ttdeci">bool setDTR()</div><div class="ttdoc">Set the bit DTR (pin 4) DTR stands for Data Terminal Ready.</div><div class="ttdef"><b>Definition:</b> serialib.cpp:738</div></div>
<div class="ttc" id="aclassserialib_html_a8a1c8803c8df1a19222d6006328534b8"><div class="ttname"><a href="classserialib.html#a8a1c8803c8df1a19222d6006328534b8">serialib::closeDevice</a></div><div class="ttdeci">void closeDevice()</div><div class="ttdoc">Close the connection with the current device.</div><div class="ttdef"><b>Definition:</b> serialib.cpp:303</div></div>
<div class="ttc" id="aclassserialib_html_aa14196b6f422584bf5eebc4ddb71d483"><div class="ttname"><a href="classserialib.html#aa14196b6f422584bf5eebc4ddb71d483">serialib::writeBytes</a></div><div class="ttdeci">char writeBytes(const void *Buffer, const unsigned int NbBytes)</div><div class="ttdoc">Write an array of data on the current serial port.</div><div class="ttdef"><b>Definition:</b> serialib.cpp:393</div></div>
<div class="ttc" id="aclassserialib_html_aa6d231cb99664a613bcb503830f73497"><div class="ttname"><a href="classserialib.html#aa6d231cb99664a613bcb503830f73497">serialib::writeChar</a></div><div class="ttdeci">char writeChar(char)</div><div class="ttdoc">Write a char on the current serial port.</div><div class="ttdef"><b>Definition:</b> serialib.cpp:327</div></div>
<div class="ttc" id="aclassserialib_html_ab05e51ff3bc47c02d7d000d58b45a961"><div class="ttname"><a href="classserialib.html#ab05e51ff3bc47c02d7d000d58b45a961">serialib::readBytes</a></div><div class="ttdeci">int readBytes(void *buffer, unsigned int maxNbBytes, const unsigned int timeOut_ms=0, unsigned int sleepDuration_us=100)</div><div class="ttdoc">Read an array of bytes from the serial device (with timeout)</div><div class="ttdef"><b>Definition:</b> serialib.cpp:599</div></div>
<div class="ttc" id="aclassserialib_html_ab0b5882339240002fccf7701f5321e0a"><div class="ttname"><a href="classserialib.html#ab0b5882339240002fccf7701f5321e0a">serialib::clearRTS</a></div><div class="ttdeci">bool clearRTS()</div><div class="ttdoc">Clear the bit RTS (pin 7) RTS stands for Data Terminal Ready.</div><div class="ttdef"><b>Definition:</b> serialib.cpp:831</div></div>
<div class="ttc" id="aclassserialib_html_ab155c84352ddefe1304d391c19497ac1"><div class="ttname"><a href="classserialib.html#ab155c84352ddefe1304d391c19497ac1">serialib::readString</a></div><div class="ttdeci">int readString(char *receivedString, char finalChar, unsigned int maxNbBytes, const unsigned int timeOut_ms=0)</div><div class="ttdoc">Read a string from the serial device (with timeout)</div><div class="ttdef"><b>Definition:</b> serialib.cpp:525</div></div>
<div class="ttc" id="aclassserialib_html_ab2b121af07fb732f82668f6a14e93cfb"><div class="ttname"><a href="classserialib.html#ab2b121af07fb732f82668f6a14e93cfb">serialib::isRTS</a></div><div class="ttdeci">bool isRTS()</div><div class="ttdoc">Get the RTS's status (pin 7) RTS stands for Request To Send May behave abnormally on Windows.</div><div class="ttdef"><b>Definition:</b> serialib.cpp:968</div></div>
<div class="ttc" id="aclassserialib_html_ac44215001ae198f2c196bb7993327a4b"><div class="ttname"><a href="classserialib.html#ac44215001ae198f2c196bb7993327a4b">serialib::~serialib</a></div><div class="ttdeci">~serialib()</div><div class="ttdoc">Destructor of the class serialib. It close the connection.</div><div class="ttdef"><b>Definition:</b> serialib.cpp:43</div></div>
<div class="ttc" id="aclassserialib_html_aca544a6f8dfa33f8e771713646768215"><div class="ttname"><a href="classserialib.html#aca544a6f8dfa33f8e771713646768215">serialib::isCTS</a></div><div class="ttdeci">bool isCTS()</div><div class="ttdoc">Get the CTS's status (pin 8) CTS stands for Clear To Send.</div><div class="ttdef"><b>Definition:</b> serialib.cpp:856</div></div>
<div class="ttc" id="aclassserialib_html_adf49bff6401d3101b41fb52e98309635"><div class="ttname"><a href="classserialib.html#adf49bff6401d3101b41fb52e98309635">serialib::clearDTR</a></div><div class="ttdeci">bool clearDTR()</div><div class="ttdoc">Clear the bit DTR (pin 4) DTR stands for Data Terminal Ready.</div><div class="ttdef"><b>Definition:</b> serialib.cpp:761</div></div>
<div class="ttc" id="aclassserialib_html_afcef685b74a3db58dc2d1898bb34aaca"><div class="ttname"><a href="classserialib.html#afcef685b74a3db58dc2d1898bb34aaca">serialib::openDevice</a></div><div class="ttdeci">char openDevice(const char *Device, const unsigned int Bauds, SerialDataBits Databits=SERIAL_DATABITS_8, SerialParity Parity=SERIAL_PARITY_NONE, SerialStopBits Stopbits=SERIAL_STOPBITS_1)</div><div class="ttdoc">Open the serial port.</div><div class="ttdef"><b>Definition:</b> serialib.cpp:124</div></div>
<div class="ttc" id="aclasstime_out_html"><div class="ttname"><a href="classtime_out.html">timeOut</a></div><div class="ttdoc">This class can manage a timer which is used as a timeout.</div><div class="ttdef"><b>Definition:</b> serialib.h:235</div></div>
<div class="ttc" id="aclasstime_out_html_a2cffa89f7b90e4501e07e8cb7ccb3117"><div class="ttname"><a href="classtime_out.html#a2cffa89f7b90e4501e07e8cb7ccb3117">timeOut::timeOut</a></div><div class="ttdeci">timeOut()</div><div class="ttdoc">Constructor of the class timeOut.</div><div class="ttdef"><b>Definition:</b> serialib.cpp:995</div></div>
<div class="ttc" id="aclasstime_out_html_a88b4caef4ce7bfc42b73a61589c098e8"><div class="ttname"><a href="classtime_out.html#a88b4caef4ce7bfc42b73a61589c098e8">timeOut::initTimer</a></div><div class="ttdeci">void initTimer()</div><div class="ttdoc">Initialise the timer. It writes the current time of the day in the structure PreviousTime.</div><div class="ttdef"><b>Definition:</b> serialib.cpp:1003</div></div>
<div class="ttc" id="aclasstime_out_html_af5db5b5f0db4f6ada19187ef8f214214"><div class="ttname"><a href="classtime_out.html#af5db5b5f0db4f6ada19187ef8f214214">timeOut::elapsedTime_ms</a></div><div class="ttdeci">unsigned long int elapsedTime_ms()</div><div class="ttdoc">Returns the time elapsed since initialization. It write the current time of the day in the structure ...</div><div class="ttdef"><b>Definition:</b> serialib.cpp:1014</div></div>
<div class="ttc" id="aserialib_8h_html_a1ecb786dca6b3ea0df424552bd25aba7"><div class="ttname"><a href="serialib_8h.html#a1ecb786dca6b3ea0df424552bd25aba7">SerialDataBits</a></div><div class="ttdeci">SerialDataBits</div><div class="ttdef"><b>Definition:</b> serialib.h:53</div></div>
<div class="ttc" id="aserialib_8h_html_a1ecb786dca6b3ea0df424552bd25aba7a0af46a1b1917daf04f071cc62409b1d0"><div class="ttname"><a href="serialib_8h.html#a1ecb786dca6b3ea0df424552bd25aba7a0af46a1b1917daf04f071cc62409b1d0">SERIAL_DATABITS_5</a></div><div class="ttdeci">@ SERIAL_DATABITS_5</div><div class="ttdef"><b>Definition:</b> serialib.h:54</div></div>
<div class="ttc" id="aserialib_8h_html_a1ecb786dca6b3ea0df424552bd25aba7a5c284f8eb4f32fa561544a95e506227d"><div class="ttname"><a href="serialib_8h.html#a1ecb786dca6b3ea0df424552bd25aba7a5c284f8eb4f32fa561544a95e506227d">SERIAL_DATABITS_16</a></div><div class="ttdeci">@ SERIAL_DATABITS_16</div><div class="ttdef"><b>Definition:</b> serialib.h:58</div></div>
<div class="ttc" id="aserialib_8h_html_a1ecb786dca6b3ea0df424552bd25aba7ae7d27f5b5b60277dccbadd399897606d"><div class="ttname"><a href="serialib_8h.html#a1ecb786dca6b3ea0df424552bd25aba7ae7d27f5b5b60277dccbadd399897606d">SERIAL_DATABITS_8</a></div><div class="ttdeci">@ SERIAL_DATABITS_8</div><div class="ttdef"><b>Definition:</b> serialib.h:57</div></div>
<div class="ttc" id="aserialib_8h_html_a1ecb786dca6b3ea0df424552bd25aba7aeaccb09be92b75b1ac6a327eb21fb161"><div class="ttname"><a href="serialib_8h.html#a1ecb786dca6b3ea0df424552bd25aba7aeaccb09be92b75b1ac6a327eb21fb161">SERIAL_DATABITS_7</a></div><div class="ttdeci">@ SERIAL_DATABITS_7</div><div class="ttdef"><b>Definition:</b> serialib.h:56</div></div>
<div class="ttc" id="aserialib_8h_html_a1ecb786dca6b3ea0df424552bd25aba7af037109ad2db2f77d36c2a9806b23978"><div class="ttname"><a href="serialib_8h.html#a1ecb786dca6b3ea0df424552bd25aba7af037109ad2db2f77d36c2a9806b23978">SERIAL_DATABITS_6</a></div><div class="ttdeci">@ SERIAL_DATABITS_6</div><div class="ttdef"><b>Definition:</b> serialib.h:55</div></div>
<div class="ttc" id="aserialib_8h_html_a2c48912c12fd98a4f4faffbc7f20a9f6"><div class="ttname"><a href="serialib_8h.html#a2c48912c12fd98a4f4faffbc7f20a9f6">SerialParity</a></div><div class="ttdeci">SerialParity</div><div class="ttdef"><b>Definition:</b> serialib.h:73</div></div>
<div class="ttc" id="aserialib_8h_html_a2c48912c12fd98a4f4faffbc7f20a9f6a0392c989829d4e47a2cc54a12cb6125a"><div class="ttname"><a href="serialib_8h.html#a2c48912c12fd98a4f4faffbc7f20a9f6a0392c989829d4e47a2cc54a12cb6125a">SERIAL_PARITY_EVEN</a></div><div class="ttdeci">@ SERIAL_PARITY_EVEN</div><div class="ttdef"><b>Definition:</b> serialib.h:75</div></div>
<div class="ttc" id="aserialib_8h_html_a2c48912c12fd98a4f4faffbc7f20a9f6a10bed0b14962edaf7e883bf186d4773b"><div class="ttname"><a href="serialib_8h.html#a2c48912c12fd98a4f4faffbc7f20a9f6a10bed0b14962edaf7e883bf186d4773b">SERIAL_PARITY_SPACE</a></div><div class="ttdeci">@ SERIAL_PARITY_SPACE</div><div class="ttdef"><b>Definition:</b> serialib.h:78</div></div>
<div class="ttc" id="aserialib_8h_html_a2c48912c12fd98a4f4faffbc7f20a9f6a2ba4057e060ceb427fb3105ef629ccf6"><div class="ttname"><a href="serialib_8h.html#a2c48912c12fd98a4f4faffbc7f20a9f6a2ba4057e060ceb427fb3105ef629ccf6">SERIAL_PARITY_MARK</a></div><div class="ttdeci">@ SERIAL_PARITY_MARK</div><div class="ttdef"><b>Definition:</b> serialib.h:77</div></div>
<div class="ttc" id="aserialib_8h_html_a2c48912c12fd98a4f4faffbc7f20a9f6a38bc0d79b89ff9341767232da5448fe8"><div class="ttname"><a href="serialib_8h.html#a2c48912c12fd98a4f4faffbc7f20a9f6a38bc0d79b89ff9341767232da5448fe8">SERIAL_PARITY_NONE</a></div><div class="ttdeci">@ SERIAL_PARITY_NONE</div><div class="ttdef"><b>Definition:</b> serialib.h:74</div></div>
<div class="ttc" id="aserialib_8h_html_a2c48912c12fd98a4f4faffbc7f20a9f6ab3213e8e4b9f1199aac388ed1b671a6e"><div class="ttname"><a href="serialib_8h.html#a2c48912c12fd98a4f4faffbc7f20a9f6ab3213e8e4b9f1199aac388ed1b671a6e">SERIAL_PARITY_ODD</a></div><div class="ttdeci">@ SERIAL_PARITY_ODD</div><div class="ttdef"><b>Definition:</b> serialib.h:76</div></div>
<div class="ttc" id="aserialib_8h_html_aa2678ddd8376c65d7cad07cd6cae5654"><div class="ttname"><a href="serialib_8h.html#aa2678ddd8376c65d7cad07cd6cae5654">SerialStopBits</a></div><div class="ttdeci">SerialStopBits</div><div class="ttdef"><b>Definition:</b> serialib.h:64</div></div>
<div class="ttc" id="aserialib_8h_html_aa2678ddd8376c65d7cad07cd6cae5654a031c032346661741186af9d0680782ec"><div class="ttname"><a href="serialib_8h.html#aa2678ddd8376c65d7cad07cd6cae5654a031c032346661741186af9d0680782ec">SERIAL_STOPBITS_2</a></div><div class="ttdeci">@ SERIAL_STOPBITS_2</div><div class="ttdef"><b>Definition:</b> serialib.h:67</div></div>
<div class="ttc" id="aserialib_8h_html_aa2678ddd8376c65d7cad07cd6cae5654a5d487c59b00736410f8512b345ce6a0d"><div class="ttname"><a href="serialib_8h.html#aa2678ddd8376c65d7cad07cd6cae5654a5d487c59b00736410f8512b345ce6a0d">SERIAL_STOPBITS_1</a></div><div class="ttdeci">@ SERIAL_STOPBITS_1</div><div class="ttdef"><b>Definition:</b> serialib.h:65</div></div>
<div class="ttc" id="aserialib_8h_html_aa2678ddd8376c65d7cad07cd6cae5654a5e9a6cef3d12988dba0fa9b9053ec3cc"><div class="ttname"><a href="serialib_8h.html#aa2678ddd8376c65d7cad07cd6cae5654a5e9a6cef3d12988dba0fa9b9053ec3cc">SERIAL_STOPBITS_1_5</a></div><div class="ttdeci">@ SERIAL_STOPBITS_1_5</div><div class="ttdef"><b>Definition:</b> serialib.h:66</div></div>
</div><!-- fragment --></div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="dir_97aefd0d527b934f1d99a682da8fe6a9.html">lib</a></li><li class="navelem"><a class="el" href="serialib_8h.html">serialib.h</a></li>
    <li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.1 </li>
  </ul>
</div>
</body>
</html>
